#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    ll n, s;
    cin >> n >> s;
    ll q = s;
    for (ll i = 1; i <= n; i++)
    {
        double p;
        cin >> p;
        if (q <= p)
        {
            q = ceil(1.0 * (p + q) / 2.0);
        }
    }
    cout << max(s, q) << "\n";
}
int main()
{
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
